﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; //Data Annotations 数据注解
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOT4Week1Day1.Domain.Models
{
    //[Table("tb_User")]  如果想改变默认的表名，则加上Table注解
    public class User
    {
        [Key]
        public int UId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [StringLength(30)]
        [Required]
        public string UserName { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [StringLength(50)]
        [Required]
        public string Account { get; set; }

        [StringLength(255)]
        [Required]
        public string EMail { get; set; }

        /// <summary>
        /// 密码（至少50个字符，因为密码通常是要进行MD5加密的）
        /// </summary>
        [StringLength(50)]
        [Required]
        public string Password { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(100)]
        public string Remark { get; set; }

        /// <summary>
        /// 逻辑删除（false：未删除，true:已删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 是否启用（false：未启用，true:已启用）
        /// </summary>
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLoginTime { get; set; }


    }
}
